js replace quotes

65

js replace quotes -

mystring = mystring.replace(/["']/g, "");

javascript replace doublequote with empty string -

const anyStr = 'Friend ... "OK" ... foo'
const formattedString = anyStr.replace(/["]/g, "\\"")

Comments

Submit
0 Comments